package cyf.Login.dao;

import cyf.Login.bean.AdminVO;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * 登录daoimpl层
 */
@Repository
public class LoginDaoImpl implements LoginDao{
    @Autowired
    public SqlSession sqlSession;

    /**
     * 登录校验
     */
    public AdminVO login(String username,String password){
        Map<String,String> map = new HashMap<>();
        map.put("admin_account",username);
        map.put("admin_password",password);
        AdminVO adminVO = sqlSession.selectOne("cyf.Login.dao.LoginDao.login",map);
//        System.out.println(adminVO.getAdmin_account()+adminVO.getAdmin_password());
        return adminVO;
    }
}
